package cn.coisini.api.search;

import cn.coisini.model.common.dtos.Result;
import cn.coisini.model.common.enums.ResultEnum;
import cn.coisini.model.dto.UserSearchDto;
import cn.coisini.model.pojo.UserSearch;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author xiangshaw
 * Description: 搜索
 */
@Tag(name = "搜索接口API", description = "查询")
@RequestMapping("/api/v1/view/search/history")
@Validated
public interface SearchControllerApi {

    @Operation(summary = "查询搜索历史")
    @GetMapping("/load")
    Result<List<UserSearch>> getUserSearch(UserSearchDto userSearchDto);

    @Operation(summary = "删除搜索历史")
    @DeleteMapping("/delete")
    Result<ResultEnum> delUserSearch(@RequestBody UserSearchDto userSearchDto);

    @Operation(summary = "新增搜索历史")
    @PostMapping("/add")
    void addUserSearch(@RequestBody UserSearchDto userSearchDto);

    @Operation(summary = "删除全部搜索历史")
    @DeleteMapping("/batchRemove")
    Result<ResultEnum> delUserSearchAll();
}
